I. QT environment settings
Files from window upload to Ubuntu will display garbled, because the Ubuntu environment is set by default is utf-8,windows default is GBK.Windows environment, Qt Creator, menu-> tool-> options-> text editor-> behavior->
As the saying goes, practice is the only standard to test truth, indeed. Oneself has been relatively lazy, although I think Daniel should be a notepad all done, but I still like to use DW or vs to write a good web page architecture, because always
#include Note: multibyte includes GBK and UTF-8int Gbk2utf8 (char *szgbk,char *szutf8,int Len){Converts multibyte GBK (CP_ACP or ANSI) to wide characters first UTF-16The number of memory characters required after the conversion is obtainedint n =
The file header contains BOM information (three bytes.The advantage is that the multi-encoding editor can correctly recognize the file encoding.
MicroSoft added ef bb bf three bytes before your own UTF-8 format text file,Notepad on
Using Python for vs new project in Windows will use the default ANSI encoding (Chinese system: GB2312), if using Chinese cannot compileWorkaround:1. Advanced save with file to change the encoding format to Utf-8, but you need to do this every time
Example code ..w.curl.html is as follows: (garbled !) {Code ...}
public function file_get(){ $file = file_get_contents('Curl.html'); iconv("ANSI", "UTF-8//IGNORE", $file); return empty($file) ? null : $file;
I have read a lot of posts saying it cannot be displayed, or it is a bug,
But why is the Chinese "China" output in the test project?
Later I found it very simple.
Just convert the file to the UTF-8 encoding format
ANSI encoding is generated by
Today, because of the need to read the directory and files in Windows, fortunately before doing this work (see "Under Linux and Windows Traversal directory method and how to achieve a consistent operation", encapsulated in Windows and Linux read
In gb2312 encoding, a Chinese character occupies 2 bytes, while in the UTF-8, a Chinese character occupies 3 bytes ". "UTF-8 encoding (in fact a unicode encoding) or Unicode encoding itself is supported, simplified Chinese characters. Traditional
Recently changed to VS2017, because at hand to do an MFC program, so write the console program to do functional testing, and then found incredibly garbled.Then use VS2017 new Windows Console application, in the main function to add a sentence printf
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.